package com.liujit.standard.basis.admin.config.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @description: 注册拦截器
 * @author: liujun
 * @create: 2021/3/24 6:40 下午
 **/
@Configuration
public class MyInterceptor implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册自己的拦截器并设置拦截的请求路径
        registry.addInterceptor(new LoginStateInterceptor())
                .addPathPatterns("/admin/*")
                .excludePathPatterns("/admin/login", "/admin/logout");
    }
}
